﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Pay.Data {
    public partial class TokenBazaarOrderMap
 : System.Data.Entity.ModelConfiguration.EntityTypeConfiguration<TokenBazaarOrder> {
        public TokenBazaarOrderMap() {
            ToTable("mc_TokenBazaarOrder", "dbo");

            HasKey(t => t.Id);
            Property(t => t.Id)
                .HasColumnName("Id")
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity)
                .IsRequired();
            Property(t => t.Price)
            .HasColumnName("Price").HasPrecision(18, 6)
           .IsRequired();
            //Relationships
            HasRequired(t => t.SellerMerchant)
              .WithMany()
              .HasForeignKey(d => d.SellerId)
              .WillCascadeOnDelete(false);
            HasRequired(t => t.BuyMerchant)
              .WithMany()
              .HasForeignKey(d => d.BuyId)
              .WillCascadeOnDelete(false);
            HasRequired(t => t.TokenBazaarProduct)
              .WithMany()
              .HasForeignKey(d => d.ProductId)
              .WillCascadeOnDelete(false);
           
        }
    }
}
